package com.example.excelgenera.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class TimeTask {
    @Autowired
    private SimpMessagingTemplate messagingTemplate;
    @Scheduled(cron = "*/5 * * * * ?")
    public void bb(){

        messagingTemplate.convertAndSend("/topic/greetings", new Greeting("hello"));
    }
}
